package com.mall.service.homepage.controller;

import com.mall.commons.common.CommonResult;
import com.mall.model.domain.CmsPrefrenceArea;
import com.mall.service.homepage.service.PrefrenceAreaService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Author Pan Rundong
 * @Date 2023-03-13 14:26
 * @Desc 商品优选Controller
 */
@RestController
@RequestMapping("prefrenceArea")
@Slf4j
public class PrefrenceAreaController {

    @Autowired
    private PrefrenceAreaService prefrenceAreaService;

    /**
     * 获取全部商品优选
     *
     * @param
     * @return com.mall.commons.common.CommonResult<java.util.List < com.mall.model.domain.CmsPrefrenceArea>>
     * @Author Pan Rundong
     */
    @GetMapping("listAll")
    public CommonResult<List<CmsPrefrenceArea>> listAll() {
        List<CmsPrefrenceArea> list = prefrenceAreaService.list();
        return CommonResult.success(list, "获取全部商品优选成功");
    }
}
